import cn.test.App;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @author hanchao
 * @date 2017/9/4 16:43
 */
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE,classes = App.class)
public class BootTeset {
    @Autowired
    private RabbitTemplate rabbitTemplate;
    @Test
    public void sendMessage() throws InterruptedException {
        //rabbitTemplate.convertAndSend("sp.test-queue","fuckfuckfuckfuck");
        rabbitTemplate.convertAndSend("sp.test-queue",123123);
        Thread.sleep(50000L);;
    }
}
